﻿using Newtonsoft.Json;
using Pay.Core;
using Pay.TO;
using System;

namespace Pay.DTO {
    /// <summary>
    /// 用户信息
    /// </summary>
	[JsonObject(MemberSerialization.OptOut)]
    public class token_user_info {
        /// <summary>
        /// 手机号
        /// </summary>
        public string mobile { get; set; }
        /// <summary>
        /// 真实姓名
        /// </summary>
        public string user_name { get; set; }
        /// <summary>
        /// 昵称
        /// </summary>
        public string nick_name { get; set; }
        /// <summary>
        /// 身份证号
        /// </summary>
        public string card_no { get; set; }
        /// <summary>
        /// 是否已实名认证
        /// </summary>
        public bool is_verify_no_card { get; set; }
        /// <summary>
        /// 实名认证审核状态
        /// </summary>
        public CertifyStatus status { get; set; }
        /// <summary>
        /// 是否邀请码认证通过
        /// </summary>
        public bool is_verify_invitation_code { get; set; }
        /// <summary>
        /// 头像
        /// </summary>
        public string photo { get; set; }
        /// <summary>
        /// 下载地址
        /// </summary>
        public string qrcode_url { get; set; }
        /// <summary>
        /// 我的好友
        /// </summary>
        public string my_friend_url { get; set; }
        /// <summary>
        /// 收货地址
        /// </summary>
        public string shipping_url { get; set; }
        /// <summary>
        /// 帮助中心
        /// </summary>
        public string help_url { get; set; }
        /// <summary>
        /// 是否显示店铺入口
        /// </summary>
        public bool is_show_shop { get; set; }
        /// <summary>
        /// 上级Id
        /// </summary>
		[JsonIgnore]
        public long parent_id { get; set; }
        /// <summary>
        /// 证件号类型：1身份证，2护照号，3港澳台往来通行证
        /// </summary>
        public int type { get; set; }
        /// <summary>
        /// 证件手持照片
        /// </summary>
        public string card_img { get; set; }
        /// <summary>
        /// 备注
        /// </summary>
        public string remark { get; set; }
        /// <summary>
        /// 是否禁用
        /// </summary>
        public bool disabled { get; set; }
        /// <summary>
        /// 是否实人认证通过
        /// </summary>
        public bool is_face { get; set; }
        /// <summary>
        /// 是否 支付完成但没有进行人脸识别
        /// </summary>
        public bool is_pay { get; set; }
    }

    /// <summary>
    /// 会员信息（后台使用）
    /// </summary>
    public class token_user_dto {
        public long id { get; set; }
        /// <summary>
        /// 商户id
        /// </summary>
        public long merchant_id { get; set; }
        /// <summary>
        /// 创建时间
        /// </summary>
        public DateTime create_time { get { return create_time_unix.Value.ToDateTime(); } }
        /// <summary>
        /// 创建时间（时间戳格式）
        /// </summary>
        public long? create_time_unix { get; set; }
        /// <summary>
        /// 马力值
        /// </summary>
        public int total_horse_power { get; set; }
        /// <summary>
        /// 红钻数
        /// </summary>
        public decimal total_red_drill { get; set; }
        /// <summary>
        /// 消费红钻总数
        /// </summary>
        public decimal consume_red_drill { get; set; }
        /// <summary>
        /// 邀请码
        /// </summary>
        public string invitation_code { get; set; }
        /// <summary>
        /// 邀请码使用次数
        /// </summary>
        public int invitation_num { get; set; }
        /// <summary>
        /// 用户真是姓名
        /// </summary>
        public string user_name { get; set; }
        /// <summary>
        /// 身份证号
        /// </summary>
        public string card_no { get; set; }
        /// <summary>
        /// 昵称
        /// </summary>
        public string name { get; set; }
        /// <summary>
        /// 手机号
        /// </summary>
        public string mobile { get; set; }
        /// <summary>
        /// 是否禁用
        /// </summary>
        public bool disabled { get; set; }
        /// <summary>
        /// 是否平台
        /// </summary>
        public bool is_platform { get; set; }
        /// <summary>
        /// 用户角色
        /// </summary>
        public UserType? user_type { get; set; }
        /// <summary>
        /// 用户角色枚举描述
        /// </summary>
        public string user_type_title {
            get {
                if (user_type == null)
                    return "";
                return ((UserType)this.user_type).ToDescription();
            }
        }
        /// <summary>
        /// 用户角色值 
        /// </summary>
        public string user_type_value { get; set; }
    }

    public class token_user_dto_ex : token_user_dto {
        /// <summary>
        /// /邀请好友记录
        /// </summary>
        public PagedResult<user_invitation_his_dto> user_invitation_his_list { get; set; }

        /// <summary>
        /// 用户转赠记录
        /// </summary>
        public PagedResult<user_red_transfer_his> user_red_transfer_his_list { get; set; }
        /// <summary>
        /// 推荐人账号
        /// </summary>
        public string parent_mobile { get; set; }
        public bool is_face { get; set; }
        public string face_time { get; set; }
    }
}
